]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Handle a missing recent-files history
authorDaniel Nylander <yeager@users.noreply.gitlab.gnome.org>
Fri, 11 Sep 2026 17:52:52 +0000 (19:52 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 18:18:08 +0000 (20:18 +0200)
On a profile without recently-used.xbel, taking a screenshot saves the PNG
but does not add it to recent files. GLib.BookmarkFile.load_from_file()
reports a missing file as GLib.FileError.NOENT, while the handler checked
GLib.BookmarkFileError.FILE_NOT_FOUND and returned.

Fixes: b89d90eb80 ("screenshot: Use GLib.BookmarkFile to save recent screenshots")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4405>
(cherry picked from commit fa82d28c3b0dcfd27e49bac291b37b5ca9237dc7)

js/ui/screenshot.js

index 499baa8f4590e9190dae8819920af31a31bd5f3d..f4353845a380411b152d021c64e7d4a0b75759aa 100644 (file)
@@ -2308,7 +2308,7 @@ function _storeScreenshot(bytes, pixbuf) {
         try {
             bookmarks.load_from_file(recentFile);
         } catch (e) {
-            if (!e.matches(GLib.BookmarkFileError, GLib.BookmarkFileError.FILE_NOT_FOUND)) {
+            if (!e.matches(GLib.FileError, GLib.FileError.NOENT)) {
                 log(`Could not open recent file ${uri}: ${e.message}`);
                 return;
             }